﻿<%@ Page Language="C#" MasterPageFile="~/Paginas/Paginas Master/Paginasweb.Master" AutoEventWireup="true" CodeBehind="AgregarCompra.aspx.cs" Inherits="bi4homev3.Paginas.AgregarCompra" Title="Página sin título" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="bi4homev3" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style15
        {
            font-family: Arial, Helvetica, sans-serif;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Submenu" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="formulario" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Registor de Compra Realizada" 
        style="font-family: Arial, Helvetica, sans-serif; font-weight: 700; text-align: left"></asp:Label>
    <b>
    <br class="style15" />
    </b>
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="257px" 
        Width="555px">
        <WizardSteps>
            <asp:WizardStep runat="server" title="Factura">
                <table class="style13">
                    <tr>
                        <td class="style15">
                            Lugar de Compra:</td>
                        <td align="left" class="style16">
                            <asp:DropDownList ID="DropDownList3" runat="server" 
                                DataSourceID="SqlDataSource1" DataTextField="nombre" 
                                DataValueField="id">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString3 %>" 
                                ProviderName="<%$ ConnectionStrings:ConnectionString3.ProviderName %>" 
                                SelectCommand="SELECT LSYS_ID as id, LSYS_NOMBRE as nombre FROM LOCAL_SYS union
select LOC_ID as id, LOC_NOMBRE as nombre from LOCAL_USR, USUARIO where FKLUG_ID = USR_ID and USR_LOGIN = :Variable">
                                <SelectParameters>
                                    <asp:SessionParameter Name="Variable" SessionField="usuario" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style15">
                            Fecha de Compra:</td>
                        <td align="left" class="style16">
                            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" 
                            EnableScriptGlobalization="True">
                            </asp:ToolkitScriptManager>
                            <asp:TextBox ID="fecha1" runat="server"></asp:TextBox>
                            <asp:CalendarExtender    
                            ID="CalendarExtender1"    
                            TargetControlID="fecha1"    
                            runat="server" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style15">
                            Monto Total:</td>
                        <td align="left" class="style16">
                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator id="Checknombre" runat="server"
                                ControlToValidate="TextBox1"
                                ErrorMessage="Campo Requerido"
                                Display="Dynamic"
                                ForeColor="Red">
                            </asp:RequiredFieldValidator>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style15">
                            Iva (Total):</td>
                        <td align="left" class="style16">
                            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server"
                                ControlToValidate="TextBox2"
                                ErrorMessage="Campo Requerido"
                                Display="Dynamic"
                                ForeColor="Red">
                            </asp:RequiredFieldValidator>
                            
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style15">
                            Numero de Factura:</td>
                        <td align="left" class="style16">
                            <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server"
                                ControlToValidate="TextBox4"
                                ErrorMessage="Campo Requerido"
                                Display="Dynamic"
                                ForeColor="Red">
                            </asp:RequiredFieldValidator>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style15">
                            &nbsp;</td>
                        <td align="left" class="style16">
                            <span class="style25">
                            <asp:Label ID="RESPUESTA" runat="server" style="color: #33CC33"></asp:Label>
                            </span>
                            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" 
                                Text="Confirmar Factura" style="text-align: center" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" title="Detalle">
                <table class="style13">
                    <tr>
                        <td class="style15">
                            Producto</td>
                        <td class="style16">
                            Cantidad</td>
                        <td class="style17">
                            Precio
                            <br />
                            Unitario</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style18">
                            <asp:DropDownList ID="DropDownList1" runat="server" 
                                DataSourceID="SqlDataSource2" DataTextField="nombre" 
                                DataValueField="PRE_ID">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString3 %>" 
                                ProviderName="<%$ ConnectionStrings:ConnectionString3.ProviderName %>" 
                                
                                SelectCommand="SELECT PRE_ID, (PRE_NOMBRE ||' '||PRE_CONTENIDONETO||' '||PRE_UNIDAD) as nombre FROM PRESENTACION ORDER BY nombre">
                            </asp:SqlDataSource>
                        </td>
                        <td class="style19">
                            <asp:TextBox ID="TextBox5" runat="server" Width="55px"></asp:TextBox>
                        </td>
                        <td class="style20">
                            <asp:TextBox ID="TextBox6" runat="server" Width="51px"></asp:TextBox>
                        </td>
                        <td class="style2">
                        </td>
                    </tr>
                    <tr>
                        <td class="style15">
                            &nbsp;</td>
                        <td class="style16">
                            &nbsp;</td>
                        <td class="style17">
                            <asp:Button ID="addproducto" runat="server" Text="Agregar a Lista" 
                                OnClick="addproducto_Click" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" StepType="Finish" Title="Finalizar">
                <span class="style25">
                <asp:Label ID="Final" runat="server" Text="Operación realizada con EXITO." style="color: #33CC33"></asp:Label>
                </span>
            </asp:WizardStep>
        </WizardSteps>
    </asp:Wizard>
</asp:Content>
